package cc.rengu.oltp.service.common.constant;

import java.io.Serializable;

/**
 * 应用常量类
 * Created by 王成 on 2018/4/9.
 */
public class AppParamConstant implements Serializable {
    public static final String DATABASE_CONF_NODE = "database";    /* 数据库配置节点名 */
    public static final String OLTP_POOL_NAME = "oltpPoolName";    /* 联机平台库连接池名称 */
    public static final String CORPORATION = "corporation";    /* 多法人数据库分离标识 */
    public static final String SQL_MAPPER_CACHE = "SQL_MAPPER_CACHE";    /* 数据库映射关系缓存名 */
    public static final String TXN_INFO_CACHE = "TXN_INFO_CACHE";    /* 交易信息缓存名 */
    public static final String CHANNEL_TXN_CACHE = "CHANNEL_TXN_CACHE";    /* 通道交易信息缓存名 */
    public static final String CHANNEL_ACQ_INFO_CACHE = "CHANNEL_ACQ_INFO_CACHE";    /* 交易渠道信息缓存名 */
    public static final String CHANNEL_ISS_INFO_CACHE = "CHANNEL_ISS_INFO_CACHE";    /* 支付通道信息缓存名 */
    public static final String CHANNEL_INFO_CFG_CACHE = "CHANNEL_INFO_CFG_CACHE";    /* 渠道配置信息缓存名 */
    public static final String RSP_CODE_MAP_CACHE = "RSP_CODE_MAP_CACHE";    /* 业务响应码缓存名 */
    public static final String CARD_BIN_CACHE = "CARD_BIN_CACHE";    /* 卡BIN配置信息缓存名 */
    public static final String BIN_CACHE_KEY = "BIN_CACHE_KEY";     /* 卡BIN长度小于6位的缓存KEY名 */
    public static final String SYS_PARAM_CACHE = "SYS_PARAM_CACHE";  /* 系统参数信息缓存名 */
    public static final String TXN_NUM_MAP_CACHE = "TXN_NUM_MAP_CACHE";    /* 交易码映射关系缓存名 */
    public static final String TXN_SENSITIVE_CFG_CACHE = "TXN_SENSITIVE_CFG_CACHE";    /* 交易敏感配置信息缓存名 */
    public static final String IMAGE_CODE_CACHE = "IMAGE_CODE_CACHE";    /* 图片验证码缓存名 */
    public static final String TRANS_MONITOR_CACHE = "TRANS_MONITOR_CACHE";    /* 交易监控缓存 */
    public static final String TRANS_CTRL_CACHE = "IGAS_TRANS_CTRL_CACHE";    /* 交易控制缓存 */
    public static final String APPLICATION_CONFIG_FILE_NAME = "/cfg/applicationConfig.xml";    /* 应用配置文件路径 */
    public static final String SYS_ID = "IGAS";    /* 本系统标识 */
    public static final String YES = "Y";    /* 正常/启用/有效 */
    public static final String NO = "N";     /* 异常/停用/无效 */
    public static final String EXCP_HANDLE_SYNC = "0";    /* 超时处理机制-同步 */
    public static final String EXCP_HANDLE_ASYN = "1";    /* 超时处理机制-异步 */
    public static final String CLUSERT_ID = "00";    /* 服务器集群默认标识 */
    public static final String FINANCE_TXN_HEAD = "P";    /* 金融类交易 */
    public static final String NON_FINANCE_TXN_HEAD = "T";    /* 非金融类交易 */
    public static final String MANAGE_TXN_HEAD = "M";    /* 管理类交易 */

    public static final String IGAS_CONFIG = "IGAS_CONFIG";    /* IGAS应用配置文件环境变量 */
    public static final String IGAS = "IGAS";    /* 统一支付平台 */
    public static String DEFAULT_INSTID = "000";    /* 默认机构常量 */
    public static final String DEFAULT_BIZ_TYPE = "00";    /* 默认交易细分 */
    public static final String DEFAULT_BIZ_CHANNEL_ID = "*";    /* 默认业务渠道标识 */
    public static final String DEFAULT_EXPIRY_DATE = "29991231";    /* 默认失效日期 */
    public static final String DEFAULT_DELIMITER = ",";    /* 默认字符串分隔符 */
    public static final String XML_ROOT_NAME = "radp";    /* XML树默认节点 */
    public static final String DEFAULT_ORDER_CCY = "156";  /* 默认币种 */
    public static final String REDIS_DATA_LOAD_FLAG = "REDIS_DATA_LOAD_FLAG";    /* redis数据加载标志 */
    public static final String LAST_MONITOR_PUSH_TIME = "lastMonitorPushTime";  /* 上次交易监控推送时间 */
    public static final String MONITOR_STATIS_KEY = "_MONITOR_STATIS_";
    public static final String MONITOR_ALL = "_ALL_";    /* 监控总统计信息 */
    public static final String MONITOR_SRC_CHANNEL = "_SCL_";    /* 渠道监控统计信息 */
    public static final String MONITOR_DST_CHANNEL = "_DCL_";    /* 通道监控统计信息 */
    public static final String MONITOR_PROD = "_PROD_";    /* 支付产品监控统计信息 */
    public static final String CREDIT = "D";    /* 贷记 */
    public static final String DEBIT = "C";    /* 借记 */
    public static final String EXCEPTION_MSG = "exceptionMsg";   /* 异常信息 */
    public static final String ALARM_MSG = "IGAS_ALARM_MSG";   /* 告警信息 */
    public static final String RISK_MONITOR_INFO = "IGAS_RISK_MONITOR_INFO";    /* 风险监控服务组件 */
    public static final String MONITOR_PUSH_FLAG = "IGAS_MONITOR_PUSH_FLAG";    /* 交易监控推送标识 */
    public static final String ALARM_PUSH_FLAG = "IGAS_ALARM_PUSH_FLAG";    /* 风险告警推送标识 */
    public static final String RISK_COLLECT_FLAG = "IGAS_RISK_COLLECT_FLAG";    /* 风险信息采集标识 */

    public static final String PLAT_SYS_PARAM = "PLAT_SYS_PARAM";    /* 平台参数 */
    public static final String TRANS_FRUSING_CTRL_FLAG = "TRANS_FRUSING_CTRL_FLAG";    /* 交易熔断控制开关 */
    public static final String TRANS_MONITOR_PUSH_FLAG = "TRANS_MONITOR_PUSH_FLAG";    /* 交易监控推送开关 */
    public static final String TRANS_MONITOR_PUSH_URL = "TRANS_MONITOR_PUSH_URL";    /* 交易监控推送URL */
    public static final String TRANS_MONITOR_PUSH_GAP = "TRANS_MONITOR_PUSH_GAP";    /* 交易监控推送间隔 */
    public static final String RISK_ALARM_PUSH_MODEL_ID = "RISK_ALARM_PUSH_MODEL_ID";    /* 风险告警推送模型ID */
    public static final String RISK_ALARM_PUSH_URL = "RISK_ALARM_PUSH_URL";    /* 风险告警推送URL */
    public static final String ALARM_PUSH_PHONE_NO = "ALARM_PUSH_PHONE_NO";    /* 风险告警联系人电话 */
    public static final String ALARM_PUSH_EMAIL = "ALARM_PUSH_EMAIL";    /* 风险告警联系人邮箱 */
    public static final String TRANS_RISK_COLLECT_FLAG = "TRANS_RISK_COLLECT_FLAG";    /* 交易风险信息采集开关 */
    public static final String MONITOR_TOTAL_SUCC_MODEL_ID = "MONITOR_TOTAL_SUCC_MODEL_ID";    /* 系统层交易成功率监控模型ID */
    public static final String MONITOR_SRC_CHANNEL_SUCC_MODEL_ID = "MONITOR_SRC_CHANNEL_SUCC_MODEL_ID";    /* 交易渠道交易成功率监控模型ID */
    public static final String MONITOR_DST_CHANNEL_SUCC_MODEL_ID = "MONITOR_DST_CHANNEL_SUCC_MODEL_ID";    /* 支付通道交易成功率监控模型ID */
    public static final String MONITOR_PROD_SUCC_MODEL_ID = "MONITOR_PROD_SUCC_MODEL_ID";    /* 支付产品交易成功率监控模型ID */
    public static final String MONITOR_TOTAL_FAIL_MODEL_ID = "MONITOR_TOTAL_FAIL_MODEL_ID";    /* 系统层交易失败率监控模型ID */
    public static final String MONITOR_SRC_CHANNEL_FAIL_MODEL_ID = "MONITOR_SRC_CHANNEL_FAIL_MODEL_ID";    /* 交易渠道交易失败率监控模型ID */
    public static final String MONITOR_DST_CHANNEL_FAIL_MODEL_ID = "MONITOR_DST_CHANNEL_FAIL_MODEL_ID";    /* 支付通道交易失败率监控模型ID */
    public static final String MONITOR_PROD_FAIL_MODEL_ID = "MONITOR_RPOD_FAIL_MODEL_ID";    /* 支付产品交易失败率监控模型ID */
    public static final String MONITOR_TOTAL_TIMEOUT_MODEL_ID = "MONITOR_TOTAL_TIMEOUT_MODEL_ID";    /* 系统层交易超时率监控模型ID */
    public static final String MONITOR_SRC_CHANNEL_TIMEOUT_MODEL_ID = "MONITOR_SRC_CHANNEL_TIMEOUT_MODEL_ID";    /* 交易渠道交易超时率监控模型ID */
    public static final String MONITOR_DST_CHANNEL_TIMEOUT_MODEL_ID = "MONITOR_DST_CHANNEL_TIMEOUT_MODEL_ID";    /* 支付通道交易超时率监控模型ID */
    public static final String MONITOR_PROD_TIMEOUT_MODEL_ID = "MONITOR_PROD_TIMEOUT_MODEL_ID";    /* 支付产品交易超时率监控模型ID */
    public static final String MONITOR_TOTAL_AVG_TXN_COST_MODEL_ID = "MONITOR_TOTAL_AVG_TXN_COST_MODEL_ID";    /* 系统层交易平均交易耗时监控模型ID */
    public static final String MONITOR_SRC_CHANNEL_AVG_TXN_COST_MODEL_ID = "MONITOR_SRC_CHANNEL_AVG_TXN_COST_MODEL_ID";    /* 交易渠道平均交易耗时监控模型ID */
    public static final String MONITOR_DST_CHANNEL_AVG_TXN_COST_MODEL_ID = "MONITOR_DST_CHANNEL_AVG_TXN_COST_MODEL_ID";    /* 支付通道平均交易耗时监控模型ID */
    public static final String MONITOR_PROD_AVG_TXN_COST_MODEL_ID = "MONITOR_PROD_AVG_TXN_COST_MODEL_ID";    /* 支付产品平均交易耗时监控模型ID */
    public static final String MONITOR_TRANS_STATIS_MODEL_ID = "MONITOR_TRANS_STATIS_MODEL_ID";    /* 交易统计信息监控模型ID */

    public static final String DEFAULT_SMS_CODE ="111111";    /* 默认短信验证码 */
    public static final String DEFAULT_ENV = "demo";    /* 默认运行环境为演示环境 */
    public static String APPLICATION_ENV = DEFAULT_ENV;

    public static void setApplicationEnv(String env){
        AppParamConstant.APPLICATION_ENV = env;
    }

    public static void setDefaultInstId(String defaultInstId) {
        AppParamConstant.DEFAULT_INSTID = defaultInstId;
    }
}
